# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.FirebaseAppDistribution.V1.Model.GdataCompositeMedia do
  @moduledoc """
  A sequence of media data references representing composite data. Introduced to support Bigstore composite objects. For details, visit http://go/bigstore-composites.

  ## Attributes

  *   `blobRef` (*type:* `String.t`, *default:* `nil`) - Blobstore v1 reference, set if reference_type is BLOBSTORE_REF This should be the byte representation of a blobstore.BlobRef. Since Blobstore is deprecating v1, use blobstore2_info instead. For now, any v2 blob will also be represented in this field as v1 BlobRef.
  *   `blobstore2Info` (*type:* `GoogleApi.FirebaseAppDistribution.V1.Model.GdataBlobstore2Info.t`, *default:* `nil`) - Blobstore v2 info, set if reference_type is BLOBSTORE_REF and it refers to a v2 blob.
  *   `cosmoBinaryReference` (*type:* `String.t`, *default:* `nil`) - A binary data reference for a media download. Serves as a technology-agnostic binary reference in some Google infrastructure. This value is a serialized storage_cosmo.BinaryReference proto. Storing it as bytes is a hack to get around the fact that the cosmo proto (as well as others it includes) doesn't support JavaScript. This prevents us from including the actual type of this field.
  *   `crc32cHash` (*type:* `integer()`, *default:* `nil`) - crc32.c hash for the payload.
  *   `inline` (*type:* `String.t`, *default:* `nil`) - Media data, set if reference_type is INLINE
  *   `length` (*type:* `String.t`, *default:* `nil`) - Size of the data, in bytes
  *   `md5Hash` (*type:* `String.t`, *default:* `nil`) - MD5 hash for the payload.
  *   `objectId` (*type:* `GoogleApi.FirebaseAppDistribution.V1.Model.GdataObjectId.t`, *default:* `nil`) - Reference to a TI Blob, set if reference_type is BIGSTORE_REF.
  *   `path` (*type:* `String.t`, *default:* `nil`) - Path to the data, set if reference_type is PATH
  *   `referenceType` (*type:* `String.t`, *default:* `nil`) - Describes what the field reference contains.
  *   `sha1Hash` (*type:* `String.t`, *default:* `nil`) - SHA-1 hash for the payload.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :blobRef => String.t() | nil,
          :blobstore2Info =>
            GoogleApi.FirebaseAppDistribution.V1.Model.GdataBlobstore2Info.t() | nil,
          :cosmoBinaryReference => String.t() | nil,
          :crc32cHash => integer() | nil,
          :inline => String.t() | nil,
          :length => String.t() | nil,
          :md5Hash => String.t() | nil,
          :objectId => GoogleApi.FirebaseAppDistribution.V1.Model.GdataObjectId.t() | nil,
          :path => String.t() | nil,
          :referenceType => String.t() | nil,
          :sha1Hash => String.t() | nil
        }

  field(:blobRef)
  field(:blobstore2Info, as: GoogleApi.FirebaseAppDistribution.V1.Model.GdataBlobstore2Info)
  field(:cosmoBinaryReference)
  field(:crc32cHash)
  field(:inline)
  field(:length)
  field(:md5Hash)
  field(:objectId, as: GoogleApi.FirebaseAppDistribution.V1.Model.GdataObjectId)
  field(:path)
  field(:referenceType)
  field(:sha1Hash)
end

defimpl Poison.Decoder, for: GoogleApi.FirebaseAppDistribution.V1.Model.GdataCompositeMedia do
  def decode(value, options) do
    GoogleApi.FirebaseAppDistribution.V1.Model.GdataCompositeMedia.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.FirebaseAppDistribution.V1.Model.GdataCompositeMedia do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
